//
//  JYJSpecialFocusTableViewCell.m
//  HappyListen
//
//  Created by 冀永金 on 16/8/30.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "JYJSpecialFocusTableViewCell.h"
#import "BaseLabel.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "JYJEventListModel.h"
#import "JYJTAMacro.h"
@interface JYJSpecialFocusTableViewCell ()
@property (nonatomic, strong) UIImageView *image;
@property (nonatomic, strong) BaseLabel *nameLabel;
@property (nonatomic, strong) UIImageView *itemImage;
@end
@implementation JYJSpecialFocusTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self configViews];
    }
    return self;
}
- (void)configViews {
    self.image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"find_cat_header"]];
    [self.contentView addSubview:_image];
    self.nameLabel = [[BaseLabel alloc]init];
    self.nameLabel.textColor = [UIColor redColor];
    _nameLabel.text = @"特别关注";
    [self.contentView addSubview:_nameLabel];
    self.itemImage = [[UIImageView alloc]init];
    [self.contentView addSubview:_itemImage];
        
}
- (void)layoutSubviews {
    [super layoutSubviews];
    [self.image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).with.offset(10);
        make.left.equalTo(self.contentView.mas_left).with.offset(10);
        make.width.mas_equalTo(35);
        make.height.mas_equalTo(35);
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).with.offset(13);
        make.left.equalTo(self.image.mas_right).with.offset(5);
        make.width.mas_equalTo (100);
        make.height.mas_equalTo(30);
    }];
    [self.itemImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.image.mas_bottom).with.offset(10);
        make.left.equalTo(self.contentView.mas_left).with.offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-10);
        make.right.equalTo(self.contentView.mas_right).with.offset(-10);
    }];
}
- (void)setModel:(JYJEventListModel *)model {
    _model = model;
    [self.itemImage sd_setImageWithURL:[NSURL URLWithString:model.content_img] placeholderImage:PLACEHOLDERIMAGE];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
